<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"
	xmlns:tx="http://www.springframework.org/schema/tx">
	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
		<property name="url" value="jdbc:mysql://localhost:3306/ref"></property>
		<property name="username" value="root"></property>
		<property name="password" value="1234"></property>
	</bean>
	
	<bean id="sessionFactory"
		class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
		<property name="dataSource">
			<ref bean="dataSource" />
		</property>
		<property name="hibernateProperties">
			<props>
				<prop key="hibernate.dialect">
					org.hibernate.dialect.MySQLDialect
				</prop>
			</props>
		</property>
		<property name="mappingResources">
			<list>
				<value>dom/domain/User.hbm.xml</value>
				<value>dom/domain/Expert.hbm.xml</value>
				<value>dom/domain/Administrator.hbm.xml</value>
				<value>dom/domain/Mobileadmistrator.hbm.xml</value>
				<value>dom/domain/Examplace.hbm.xml</value>
				<value>dom/domain/ExpertAllocate.hbm.xml</value>
				<value>dom/domain/Generaltype.hbm.xml</value>
				<value>dom/domain/Subtype.hbm.xml</value>
				<value>dom/domain/Score.hbm.xml</value></list>
		</property>
	</bean>
	<bean id="fileService" class="model.service.FileService">
		<property name="userDao" ref="UserDAO"></property>
		<property name="toExcel" ref="ToExcel"></property>
	</bean>
	<bean id="EPService" class="model.service.EPService">
		<property name="epDao" ref="ExamplaceDAO"></property>
	</bean>
	<bean id = "expertService" class="model.service.ExpertService">
		<property name="epDao" ref = "ExamplaceDAO"> </property>
		<property name="expertDao" ref = "ExpertDAO"> </property>
	</bean>
	<bean name="userService" class="model.service.UserService">
		<property name="userDao" ref="UserDAO"></property>
		<property name="epDao" ref="ExamplaceDAO"></property>
		<property name="gDao" ref="GeneraltypeDAO"></property>
		<property name="subDao" ref="SubtypeDAO"></property>
		<property name="scoreDao" ref="ScoreDAO"></property>
	</bean>
	<bean name="adminService" class="model.service.AdminService">
		<property name="adminDao" ref="AdministratorDAO"></property>
		<property name="admin" ref="Admin"></property>
	</bean>
	<bean id="ToExcel" class="model.service.ToExcel">
		<property name="userDao" ref="UserDAO"></property>
		<property name="expertDao" ref="ExpertDAO"></property>
		<property name="mAdminDao" ref="MobileadmistratorDAO"></property>
		<property name="epDao" ref="ExamplaceDAO"></property>
		<property name="scoreDao" ref="ScoreDAO"></property>
	</bean>
	<bean id="User" class="dom.domain.User"></bean>
	<bean id="Admin" class="dom.domain.Administrator"></bean>
	<bean id="Expert" class="dom.domain.Expert"></bean>
	<bean id="registServ" class="model.service.registService">
		<property name="userDao" ref="UserDAO"></property>
		<property name="user" ref="User"></property>
	</bean>
	<bean id="transactionManager"
		class="org.springframework.orm.hibernate4.HibernateTransactionManager">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<bean id="loginServ" class="model.service.loginService">
		<property name="userDao" ref="UserDAO"></property>
	</bean>
	
	<bean id="UserDAO" class="dom.domain.UserDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="ExpertDAO" class="dom.domain.ExpertDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="AdministratorDAO" class="dom.domain.AdministratorDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="MobileadmistratorDAO"
		class="dom.domain.MobileadmistratorDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<tx:annotation-driven transaction-manager="transactionManager" />
	<bean id="generalService" class="model.service.GeneralTypeService">
		<property name="gDao" ref = "GeneraltypeDAO"></property>
	</bean>
	<bean id="subService" class="model.service.SubTypeService">
		<property name="gDao" ref = "GeneraltypeDAO"></property>
		<property name="subDao" ref = "SubtypeDAO"></property>
	</bean>
	<bean id="ExamplaceDAO" class="dom.domain.ExamplaceDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="ExpertAllocateDAO" class="dom.domain.ExpertAllocateDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="GeneraltypeDAO" class="dom.domain.GeneraltypeDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="SubtypeDAO" class="dom.domain.SubtypeDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="ScoreDAO" class="dom.domain.ScoreDAO">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="mAdminService" class="model.service.MAdminService">
		<property name= "epDao" ref = "ExamplaceDAO"></property>
		<property name="mAdminDao" ref = "MobileadmistratorDAO"></property>
	</bean></beans>